<?php
/**
 * Created by PhpStorm.
 * User: Jozef Môstka
 * Date: 5/25/14
 * Time: 7:22 PM
 */

class TestObject {
    public /*String[]*/ $aaa = ["ss","dd"];
    public /*int[]*/    $bbb = [null,null];
	public /*double[]*/ $ccc = [2,5,6,4];
	public /*char[]*/   $ddd = [null,null];
	public /*long[]*/   $eee = [null,null];
	public /*byte[]*/   $fff = [null,null];
	protected/*short[]*/$ggg ;
	public /*boolean[]*/$hhh = [false,false];
	public /*TestObject[]*/     $object = [null,null];
	public /*TestObject2[]*/ $object2 = [null,null];
	public /*String*/   $iii = "nie super";

    public function __construct(){
        $object2[1]=new TestObject2();
    }



    public function equals(TestObject $o){
        echo "\t[INFO] testing TestObject".PHP_EOL;
        return
            $this->assert_($this->aaa, $o->aaa,"aaa") &&
            $this->assert_($this->bbb, $o->bbb,"bbb") &&
            $this->assert_($this->ccc, $o->ccc,"ccc") &&
            $this->assert_($this->ddd, $o->ddd,"ddd") &&
            $this->assert_($this->eee, $o->eee,"eee") &&
            $this->assert_($this->fff, $o->fff,"fff") &&
            $this->assert_($this->ggg, $o->ggg,"ggg") &&
            $this->assert_($this->hhh, $o->hhh,"hhh") &&
            $this->assert_($this->iii, $o->iii,"iii");
    }
    private function assert_($a,$b,$m){
        if ($a==$b){
            echo ("\t\t[OK] ".$m.PHP_EOL);
        }else{
            echo ("\t\t[ERROR] ".$m.PHP_EOL."\t\t".json_encode($a).PHP_EOL."\t\t".json_encode($b).PHP_EOL);
        }
        return $a==$b;
    }
} 